class Solution {
public:
    vector<int> findIndices(vector<int>& nums, int x, int y) {
        vector<int>ans;
        int n = nums.size();
        for (int i = 0; i < n; i++) {
            for (int j = i + x; j < n; j++) {
                if (abs(nums[i] - nums[j]) >= y) {
                    ans.push_back(i);
                    ans.push_back(j);
                    return ans;
                }
            }
        }
        ans.push_back(-1);
        ans.push_back(-1);
        return ans;
    }
};